
function hiddenDiv(divId) {	
	document.getElementById(divId).setAttribute("class", "div_info_hidden");
}

function showDiv(divId, event) {	
	//document.getElementById(divId).setAttribute("class", "div_info_show");

	var px, py;
	var marginTop = 73;
	var marginLeft = 285;

	if (!document.all) {
		py = event.pageY;
		px = event.pageX;
	} else {
		py = event.clientY + document.body.scrollTop;
		px = event.clientX + document.body.scrollLeft;
	}

	// Modificamos el contenido de la capa
	document.getElementById(divId).setAttribute("class", "popover fade left in div_info_show");
	
	// Posicionamos la capa flotante TODO ajustar px y py con (x = x+largoCaja, etc)
	document.getElementById(divId).style.top =  (py-marginTop)  + "px";
	document.getElementById(divId).style.left = (px-marginLeft) + "px";
} 

function showHiddenComponentData(component) {
	
	//ocultamos todos los divs de componentes
	
	hiddenDiv('firewallData');
	hiddenDiv('hd_RamData');
	hiddenDiv('networkCardData');
	hiddenDiv('powerSupplyData');
	hiddenDiv('processorData');
	
	//mostramos el div adecuado
	var componentType = document.getElementById(component).value;
	
	switch(componentType) {
	case "Firewall":
		document.getElementById('firewallData').setAttribute("class", "");
		break;	
	case "HardDisk":
	case "RamMemory":
		document.getElementById('hd_RamData').setAttribute("class", "");
		break;
	case "NetworkCard":
			document.getElementById('networkCardData').setAttribute("class", "");
			break;
	case "PowerSupply":
		document.getElementById('powerSupplyData').setAttribute("class", "");
		break;
	case "Processor":	
		document.getElementById('processorData').setAttribute("class", "");
		break;
	}
}









